<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../../taglib.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<base href="<%=basePath%>" />
<title>fieldtemplatelist</title>
<%@ include file="/webmodules/console/css.jsp"%>
<%@ include file="/webmodules/console/js.jsp"%>
<script type="text/javascript">
	$(function() {
		var folder = '${fn:replace(param.folder,"\\","\\\\")}';
		$('#mydatagrid').datagrid({
			url : 'dragon/model/action/ModelHandler/list.ejw?type=${param.type}&folder='+encodeURI(folder),
			singleSelect : true,
			remoteSort : false,
			rownumbers : true,
			columns : [ [ {
				field : 'orderNum',
				title : '序列号',
				sortable : true,
				width : 50
			}, {
				field : 'code',
				title : '编码',
				sortable : true,
				width : 150
			}, {
				field : 'name',
				title : '名称',
				sortable : true,
				width : 200,
				formatter : function(val, row) {
					return "<a href='javascript:void(0);' onclick='javascript:top.showWindow(\"ModelView\",\"模型查看\",\"webviews/model/view.jsp?window=ModelView&type=${param.type}&code=" + row.code + "\",null,null,null,true);' target='_blank'>" + val + "</a>";
				}
			}, {
				field : 'description',
				title : '描述',
				width : 400
			}, {
				field : 'issystem',
				title : '系统',
				width : 40,
				formatter : function(val, row) {
					if (val == 0) {
						return '否';
					} else {
						return "<font color=\"blue\" style=\"font-weight: bold;\">是</font>";
					}
				}

			}
			<c:if test="${param.type=='BizObject'}">
			, {
				field : 'isactive',
				title : '启用',
				width : 40,
				formatter : function(val, row) {
					if (val == 1) {
						return '是';
					} else {
						return "<font color=\"red\">否</font>";
					}
				}
			}, {
				field : 'ops',
				title : '操作',
				width : 150,
				formatter : function(val, row) {
					return "<a href='javascript:void(0);' onclick='top.showWindow(\"authorize\",\"功能操作授权\",\"dragon/model/action/BizObjectHandler.ejw?bizCode=model_process_permissions&CODE="+row.code+"\",800,500);'>操作授权</a>";
				}
			}
			</c:if>] ]
		});
		
		$('#mydatagrid').datagrid({
			rowStyler: function(index,row){
				if (row.issystem == 1){
					return 'background-color:#6293BB;color:#fff;';
				}
			}
		});
	});
</script>
</head>
<body>
	<table id="mydatagrid" fit="true"></table>
</body>
</html>
